-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: convert BackendTLSPolicies
into service annotations
#6753
base: main
Are you sure you want to change the base?
Conversation
03b4d14
to
9d8d427
Compare
BackendTLSPolicies
into service annotations
250d107
to
343d922
Compare
c74c408
to
7800ee4
Compare
de488b5
to
c095f6b
Compare
Note for the reviewers: take a look at the PR description where I've put some notes about what has been implemented and what's still missing. |
7453d19
to
ef08584
Compare
CacheSyncTimeout: r.CacheSyncTimeout, | ||
}). | ||
Watches(&corev1.ConfigMap{}, | ||
&handler.EnqueueRequestForObject{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an explicit limit on ConfigMap
s to watch by labels to prevent potential excessive memory consumption to look at all ConfigMap
s, or provide an option to add such filter, as Jintao did for Secret
s?
The total number of ConfigMap
s could be very large and most of them would not be relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll add it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the BackendTLSPolicies are converted into a set of annotations that are already supported by KIC. Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
8e87773
to
ecd4668
Compare
// Allow the certificate key to be named either "cert" or "ca.crt" | ||
caCertbytes, certExists := certConfigMap.Data["cert"] | ||
if !certExists { | ||
caCertbytes, certExists = certConfigMap.Data["ca.crt"] | ||
if !certExists { | ||
relatedObjects := getPluginsAssociatedWithCACertSecret(certID, t.storer) | ||
relatedObjects = append(relatedObjects, certConfigMap.DeepCopy()) | ||
t.registerTranslationFailure(fmt.Sprintf(`invalid configmap CA certificate %s/%s, neither "cert" nor "ca.crt" key exist`, certConfigMap.Namespace, certConfigMap.Name), relatedObjects...) | ||
continue | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically the same as 37:47
. Maybe it's worth having a common helper for this? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. I've refactored the function in 4ab2f38
Co-authored-by: Jakub Warczarek <[email protected]> Co-authored-by: Patryk Małek <[email protected]>
Co-authored-by: Jakub Warczarek <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
6159e82
to
1a392ac
Compare
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
1a392ac
to
de81f12
Compare
Signed-off-by: Mattia Lavacca <[email protected]>
What this PR does / why we need it:
This PR completes the logic needed to implement
BackendTLSPolicy
. The following 3 main parts have been implemented:BackendTLSPolicy
controller by validating the policy and setting theAccepted
condition accordingly.BackendTLSPolicy
features have been converted into the proper set of service annotations.configMap
controller, as theCACertificates
referenced by the policies need to be set inconfigMap
s by the specification.Which issue this PR fixes:
Part of #6631
Special notes for your reviewer:
Integration and env tests are still missing as the PR size is already big enough. The next PR will be the last one, where I'll implement such tests and close #6631.
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR